#ifndef accountmanager_utils_item_h
#define accountmanager_utils_item_h

#include <utils/utils_decl.h>

#include <utils/core/string.h>

#include <QDate>

namespace AccountManagerUtils {
	class Category;
}

namespace AccountManagerUtils {
	
//! Information about an expense item
/*!
 *  An item holds a name, a value and an optional category.
 */
class _accountmanager_utils_decl Item {

public:
	typedef float ValueType;

public:
	Item();
	Item(const Item& rhs);
	Item(const QDate& date, ValueType value);
	Item(const QDate& date, ValueType value, const String& name);
	Item(const QDate& date, ValueType value, const String& name, Category* category);
	~Item();
	Item& operator=(const Item& rhs);

	bool operator==(const Item& rhs) const;
	bool operator!=(const Item& rhs) const;
	
	QDate& date();
	const QDate& date() const;
	String& name();
	const String& name() const;
	ValueType& value();
	ValueType value() const;
	void set_category(const Category* category);
	const Category* category() const;

private:
	QDate date_;
	String name_;
	ValueType value_;
	const Category* category_;
};

} // namespace AccountManagerUtils

#endif
